package org.ehe.erp.domain.product.bo;


import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import org.ehe.erp.domain.product.ErpProduct;

import java.math.BigDecimal;

/**
 * 产品信息业务对象 erp_product
 *
 * @author zhangnn
 * @date 2025-08-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ErpProduct.class, reverseConvertGenerate = false)
public class ErpProductBo extends BaseEntity {

    /**
     * 产品编号
     */
    @NotNull(message = "产品编号不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 产品名称
     */
    @NotBlank(message = "产品名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 产品条码
     */
    //@NotBlank(message = "产品条码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String barCode;

    /**
     * 产品分类编号
     */
    @NotNull(message = "产品分类编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String categoryCode;

    private String workstationCode;

    /**
     * 类型：标准、外协、外购
     */
    private String type;

    /**
     * 自定义编码
     */
    private String customizeCode;

    /**
     * 单位编号
     */
    @NotNull(message = "单位编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long unitId;

    /**
     * 产品状态
     */
    @NotNull(message = "产品状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long status;

    /**
     * 产品规格
     */
    private String standard;

    /**
     * 产品备注
     */
    private String remark;

    /**
     * 保质期天数
     */
    private Long expiryDay;

    /**
     * 基础重量（kg）
     */
    //@NotNull(message = "基础重量（kg）不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal weight;

    /**
     * 采购价格，单位：元
     */
    //@NotNull(message = "采购价格，单位：元不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal purchasePrice;

    /**
     * 销售价格，单位：元
     */
    //@NotNull(message = "销售价格，单位：元不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal salePrice;

    /**
     * 最低价格，单位：元
     */
    //@NotNull(message = "最低价格，单位：元不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal minPrice;


    /**
     * 材质
     */
    @NotBlank(message = "材质不能为空", groups = { AddGroup.class, EditGroup.class })
    private String material;

    /**
     * 数量
     */
    private Integer countNo = 0;
    /**
     * 仓库
     */
    private Long warehouse;
    /**
     * 仓位
     */
    private Long warehousePosition;


}
